Class Emitter


public class Emitter extends IEmitter
Default particle generator that implements IEmitter. Initialize an Emitter using Particles.createCopy(particleengine.Emitter, com.fs.starfarer.api.graphics.SpriteAPI, int, int, int). After setting the emitter's properties, generate particles using Particles.burst(particleengine.IEmitter, int) or Particles.stream(particleengine.IEmitter, int, float, float).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acceleration(float minX, float maxX, float minY, float maxY)
    Sets the acceleration of generated particles along the emitter's axes.
    void
    acceleration(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
    Sets the component-wise minimum and maximum accelerations of generated particles along the emitter's axes.
    void
    alphaShift(float minA, float maxA)
     
    void
    circleAcceleration(float innerRadius, float outerRadius)
    Adds circular randomness to the accelerations of particles generated by this Emitter.
    void
    circleOffset(float innerRadius, float outerRadius)
    Adds circular randomness to the positions of particles generated by this Emitter.
    void
    circleVelocity(float innerRadius, float outerRadius)
    Adds circular randomness to the velocities of particles generated by this Emitter.
    void
    color(float[] rgba)
     
    void
    color(float r, float g, float b, float a)
    Sets the initial color of particles generated by this Emitter.
    void
    color(Color color)
     
    void
    colorHSVA(float[] hsva)
    Sets the initial color of particles generated by this Emitter.
    void
    colorShiftHSVA(float[] hsva)
     
    void
    colorShiftHSVA(float[] minHSVA, float[] maxHSVA)
     
    void
    colorShiftHSVA(float h, float s, float v, float a)
    Adds color shift to particles, allowing individual particles to change color over time.
    void
    colorShiftHSVA(float minH, float maxH, float minS, float maxS, float minV, float maxV, float minA, float maxA)
    Adds color shift to particles, allowing individual particles to change color over time.
    void
    colorValueShift(float minV, float maxV)
     
    void
    facing(float minAngle, float maxAngle)
    Sets minimum and maximum initial facing angles of particles generated by this Emitter.
    void
    fadeTime(float minFadeIn, float maxFadeIn, float minFadeOut, float maxFadeOut)
    Sets the fade-in and fade-out times for particles generated by this Emitter.
    void
    fromJSON(org.json.JSONObject json)
    Loads properties from a JSON object.
    int
     
    int
     
    int
     
    com.fs.starfarer.api.campaign.CampaignEngineLayers
     
    com.fs.starfarer.api.combat.CombatEngineLayers
     
    org.lwjgl.util.vector.Vector2f
     
    float
     
    com.fs.starfarer.api.graphics.SpriteAPI
     
    float
     
    void
    growthAcceleration(float minAcceleration, float maxAcceleration)
    Sets the growth acceleration of particles generated by this Emitter.
    void
    growthAcceleration(float minXAcceleration, float maxXAcceleration, float minYAcceleration, float maxYAcceleration)
    Same as growthAcceleration(float, float), but allows specification of x-scale and y-scale separately.
    void
    growthRate(float minRate, float maxRate)
    Sets the initial growth rate of particles generated by this Emitter.
    void
    growthRate(float minXRate, float maxXRate, float minYRate, float maxYRate)
    Same as growthRate(float, float), but allows specification of x-scale and y-scale separately.
    void
    hueShift(float minH, float maxH)
     
    boolean
     
    void
    life(float minLife, float maxLife)
    Sets the minimum and maximum lifetime of particles generated by this Emitter.
    void
    offset(float minX, float maxX, float minY, float maxY)
    Sets the position of generated particles relative to this emitter's location.
    void
    offset(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
    Sets the component-wise minimum and maximum positions of generated particles relative to this emitter's location, along the emitter's axes.
    void
    radialAcceleration(float minAcceleration, float maxAcceleration)
    Adds acceleration in the direction from the emitter's location to each individual particle's randomized position.
    void
    radialVelocity(float minVelocity, float maxVelocity)
    Adds velocity in the direction from the emitter's location to each individual particle's randomized position.
    void
    randomHSVA(float[] hsva)
     
    void
    randomHSVA(float h, float s, float v, float a)
    Randomizes the initial color of particles generated by this Emitter.
    void
    revolutionAcceleration(float minAcceleration, float maxAcceleration)
     
    void
    revolutionRate(float minRate, float maxRate)
    Causes particles to revolve around the emitter's location at the time of generation.
    void
    saturationShift(float minS, float maxS)
     
    void
    setAlwaysRenderInCampaign(boolean alwaysRender)
    If true, particles will persist between screen transitions (but their positions will not be adjusted).
    void
    setAxis(float dir)
     
    void
    setAxis(org.lwjgl.util.vector.Vector2f xAxis)
    Sets the axes of this emitter's coordinate system.
    void
    setBlendMode(int sfactor, int dfactor, int blendMode)
    Sets the blend source factor, destination factor, and blending function.
    void
    setCampaignLayer(com.fs.starfarer.api.campaign.CampaignEngineLayers layer)
    Sets the rendering layer of this emitter.
    void
    setInactiveBorder(float amount)
    Sets the "render radius" of the emitter.
    void
    setLayer(com.fs.starfarer.api.combat.CombatEngineLayers layer)
    Sets the rendering layer of this emitter.
    void
    setLocation(float x, float y)
    Sets this emitter's location.
    void
    setLocation(org.lwjgl.util.vector.Vector2f location)
     
    void
    setSprite(com.fs.starfarer.api.graphics.SpriteAPI sprite)
    Sets the sprite used by this emitter.
    void
    Sets the sprite used by this emitter.
    void
    setSyncSize(boolean sync)
    Sets whether generated particles should always have the same x and y scale.
    void
    sinusoidalMotionX(float minAmplitude, float maxAmplitude, float minFrequency, float maxFrequency, float minPhase, float maxPhase)
    Adds periodic motion along the emitter's x-axis.
    void
    sinusoidalMotionY(float minAmplitude, float maxAmplitude, float minFrequency, float maxFrequency, float minPhase, float maxPhase)
     
    void
    size(float minSize, float maxSize)
    Sets the size of particles generated by this Emitter.
    void
    size(float minXSize, float maxXSize, float minYSize, float maxYSize)
    Same as size(float, float), but allows specification of x-scale and y-scale separately.
    void
    turnAcceleration(float minAcceleration, float maxAcceleration)
    Sets minimum and maximum turn rate accelerations for particles generated by this Emitter.
    void
    turnRate(float minRate, float maxRate)
    Sets minimum and maximum initial turn rates for particles generated by this Emitter.
    void
    velocity(float minX, float maxX, float minY, float maxY)
    Sets the velocity of generated particles along the emitter's axes.
    void
    velocity(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
    Sets the component-wise minimum and maximum velocities of generated particles along the emitter's axes.
    void
    Writes this emitter's properties to a file with the given name.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • setInactiveBorder

      public void setInactiveBorder(float amount)
      Sets the "render radius" of the emitter. Formally, if an emitter is outside the box [-amount,W+amount]x[-amount,H+amount] relative to the viewport when particles would have been generated, that generate call is ignored.
      Parameters:
      amount - Border amount, in world units.
    • setLayer

      public void setLayer(com.fs.starfarer.api.combat.CombatEngineLayers layer)
      Sets the rendering layer of this emitter. See CombatEngineLayers for an ordered list of possible values.
      Parameters:
      layer - Combat layer to render particles to
    • setCampaignLayer

      public void setCampaignLayer(com.fs.starfarer.api.campaign.CampaignEngineLayers layer)
      Sets the rendering layer of this emitter. See CampaignEngineLayers for an ordered list of possible values.
      Parameters:
      layer - Combat layer to render particles to
    • setAlwaysRenderInCampaign

      public void setAlwaysRenderInCampaign(boolean alwaysRender)
      If true, particles will persist between screen transitions (but their positions will not be adjusted). See IEmitter.isAlwaysRenderInCampaign() for more details.
      Parameters:
      alwaysRender - Whether particles should persist through campaign screen transitions
    • setLocation

      public void setLocation(float x, float y)
      Sets this emitter's location. To set the starting position of particles relative to this emitter, use offset(float, float, float, float).
      Parameters:
      x - Initial x-position, in absolute world units.
      y - Initial y-position, in absolute world units.
    • setLocation

      public void setLocation(org.lwjgl.util.vector.Vector2f location)
      See Also:
    • setAxis

      public void setAxis(org.lwjgl.util.vector.Vector2f xAxis)
      Sets the axes of this emitter's coordinate system. Defaults to global axes, i.e. (0, 1) and (1, 0).
      Parameters:
      xAxis - The emitter's x-axis. Doesn't need to be normalized. If degenerate, will be set to the default value (0, 1). The emitter's y-axis will automatically be set to the unit vector that is counterclockwise perpendicular to xAxis.
    • setAxis

      public void setAxis(float dir)
      See Also:
    • setSprite

      public void setSprite(com.fs.starfarer.api.graphics.SpriteAPI sprite)
      Sets the sprite used by this emitter.
      Parameters:
      sprite - Sprite to use. Can be null.
    • setSprite

      public void setSprite(String loc)
      Sets the sprite used by this emitter.
      Parameters:
      loc - Location of sprite to use. If null, will set the sprite to null.
    • setBlendMode

      public void setBlendMode(int sfactor, int dfactor, int blendMode)
      Sets the blend source factor, destination factor, and blending function.
      Parameters:
      sfactor - Source factor, e.g. GL11.GL_SRC_ALPHA.
      dfactor - Destination factor, e.g. GL11.GL_ONE_MINUS_SRC_ALPHA.
      blendMode - Blending operator, e.g. GL14.GL_FUNC_ADD.
    • life

      public void life(float minLife, float maxLife)
      Sets the minimum and maximum lifetime of particles generated by this Emitter. Particles exceeding their lifespan are not rendered.
      Parameters:
      minLife - Minimum lifetime, in seconds.
      maxLife - Maximum lifetime, in seconds.
    • fadeTime

      public void fadeTime(float minFadeIn, float maxFadeIn, float minFadeOut, float maxFadeOut)
      Sets the fade-in and fade-out times for particles generated by this Emitter. Particles' alpha values rise linearly from 0 to 1 within the fade-in window, and fall linearly from 1 to 0 within the fade-out window.
      Parameters:
      minFadeIn - Minimum fade-in time, in seconds.
      maxFadeIn - Maximum fade-in time, in seconds.
      minFadeOut - Minimum fade-out time, in seconds.
      maxFadeOut - Maximum fade-out time, in seconds.
    • offset

      public void offset(float minX, float maxX, float minY, float maxY)
      Sets the position of generated particles relative to this emitter's location. This position is defined along the emitter's axes.
      Parameters:
      minX - Minimum offset of particles along the emitter's x-axis in world units.
      maxX - Maximum offset of particles along the emitter's x-axis in world units.
      minY - Minimum offset of particles along the emitter's y-axis in world units.
      maxY - Maximum offset of particles along the emitter's y-axis in world units.
    • offset

      public void offset(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
      Sets the component-wise minimum and maximum positions of generated particles relative to this emitter's location, along the emitter's axes.
      Parameters:
      min - Minimum x and y offsets.
      max - Maximum x and y offsets.
    • velocity

      public void velocity(float minX, float maxX, float minY, float maxY)
      Sets the velocity of generated particles along the emitter's axes.
      Parameters:
      minX - Minimum velocity of particles along the emitter's x-axis in world units / s.
      maxX - Maximum velocity of particles along the emitter's x-axis in world units / s.
      minY - Minimum velocity of particles along the emitter's y-axis in world units / s.
      maxY - Maximum velocity of particles along the emitter's y-axis in world units / s.
    • velocity

      public void velocity(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
      Sets the component-wise minimum and maximum velocities of generated particles along the emitter's axes.
      Parameters:
      min - Minimum x and y velocities.
      max - Maximum x and y velocities.
    • acceleration

      public void acceleration(float minX, float maxX, float minY, float maxY)
      Sets the acceleration of generated particles along the emitter's axes.
      Parameters:
      minX - Minimum acceleration of particles along the emitter's x-axis in world units / s^2.
      maxX - Maximum acceleration of particles along the emitter's x-axis in world units / s^2.
      minY - Minimum acceleration of particles along the emitter's y-axis in world units / s^2.
      maxY - Maximum acceleration of particles along the emitter's y-axis in world units / s^2.
    • acceleration

      public void acceleration(org.lwjgl.util.vector.Vector2f min, org.lwjgl.util.vector.Vector2f max)
      Sets the component-wise minimum and maximum accelerations of generated particles along the emitter's axes.
      Parameters:
      min - Minimum x and y accelerations.
      max - Maximum x and y accelerations.
    • circleOffset

      public void circleOffset(float innerRadius, float outerRadius)
      Adds circular randomness to the positions of particles generated by this Emitter. Generated particles will have a random vector inside an annulus with inner radius innerRadius and outer radius outerRadius added to their positions.
      Parameters:
      innerRadius - Inner radius of annulus inside which a random vector will be chosen to be added to each particle's starting position.
      outerRadius - Outer radius of annulus inside which a random vector will be chosen to be added to each particle's starting position.
    • circleVelocity

      public void circleVelocity(float innerRadius, float outerRadius)
      Adds circular randomness to the velocities of particles generated by this Emitter. Generated particles will have a random vector inside an annulus with inner radius innerRadius and outer radius outerRadius added to their velocities.
      Parameters:
      innerRadius - Inner radius of annulus inside which a random vector will be chosen to be added to each particle's initial velocity.
      outerRadius - Outer radius of annulus inside which a random vector will be chosen to be added to each particle's initial velocity.
    • circleAcceleration

      public void circleAcceleration(float innerRadius, float outerRadius)
      Adds circular randomness to the accelerations of particles generated by this Emitter. Generated particles will have a random vector inside an annulus with inner radius innerRadius and outer radius outerRadius added to their accelerations.
      Parameters:
      innerRadius - Inner radius of annulus inside which a random vector will be chosen to be added to each particle's initial acceleration.
      outerRadius - Outer radius of annulus inside which a random vector will be chosen to be added to each particle's initial acceleration.
    • facing

      public void facing(float minAngle, float maxAngle)
      Sets minimum and maximum initial facing angles of particles generated by this Emitter. Each particle will have an initial facing randomly chosen between the two given angles. A facing direction of 0 is oriented along this emitter's x-axis.
      Parameters:
      minAngle - Minimum initial facing direction, in degrees.
      maxAngle - Maximum initial facing direction, in degrees.
    • turnRate

      public void turnRate(float minRate, float maxRate)
      Sets minimum and maximum initial turn rates for particles generated by this Emitter. Each particle will have an initial turn rate randomly chosen between the two given numbers.
      Parameters:
      minRate - Minimum initial turn rate, in degrees / s.
      maxRate - Maximum initial turn rate, in degrees / s.
    • turnAcceleration

      public void turnAcceleration(float minAcceleration, float maxAcceleration)
      Sets minimum and maximum turn rate accelerations for particles generated by this Emitter. Each particle will have a turn rate acceleration randomly chosen between the two given numbers.
      Parameters:
      minAcceleration - Minimum initial turn rate acceleration, in degrees / s^2.
      maxAcceleration - Maximum initial turn rate acceleration, in degrees / s^2.
    • size

      public void size(float minSize, float maxSize)
      Sets the size of particles generated by this Emitter. Each particle is given a size randomly chosen between minSize and maxSize.
      Parameters:
      minSize - Minimum initial particle size, in world units.
      maxSize - Maximum initial particle size, in world units.
    • growthRate

      public void growthRate(float minRate, float maxRate)
      Sets the initial growth rate of particles generated by this Emitter. Each particle is given a growth rate randomly chosen between minRate and maxRate.
      Parameters:
      minRate - Minimum initial particle growth rate, in world units / s.
      maxRate - Maximum initial particle growth rate, in world units / s.
    • growthAcceleration

      public void growthAcceleration(float minAcceleration, float maxAcceleration)
      Sets the growth acceleration of particles generated by this Emitter. Each particle is given a growth acceleration randomly chosen between minAcceleration and maxAcceleration.
      Parameters:
      minAcceleration - Minimum particle growth acceleration, in world units / s^2.
      maxAcceleration - Maximum particle growth acceleration, in world units / s^2.
    • size

      public void size(float minXSize, float maxXSize, float minYSize, float maxYSize)
      Same as size(float, float), but allows specification of x-scale and y-scale separately.
    • growthRate

      public void growthRate(float minXRate, float maxXRate, float minYRate, float maxYRate)
      Same as growthRate(float, float), but allows specification of x-scale and y-scale separately.
    • growthAcceleration

      public void growthAcceleration(float minXAcceleration, float maxXAcceleration, float minYAcceleration, float maxYAcceleration)
      Same as growthAcceleration(float, float), but allows specification of x-scale and y-scale separately.
    • setSyncSize

      public void setSyncSize(boolean sync)
      Sets whether generated particles should always have the same x and y scale. If this is set, then only the emitter's x values will be taken into account for size, growth rate, and growth acceleration.
      Parameters:
      sync - If true, ensures that generated particles have the same x and y sizes, growth rates, and growth accelerations. If false, these properties will have their x and y values set independently.
    • color

      public void color(float r, float g, float b, float a)
      Sets the initial color of particles generated by this Emitter.
      Parameters:
      r - Initial red value, between 0 and 1.
      g - Initial green value, between 0 and 1.
      b - Initial blue value, between 0 and 1.
      a - Initial alpha value, between 0 and 1.
    • color

      public void color(Color color)
      See Also:
    • color

      public void color(float[] rgba)
      See Also:
    • colorHSVA

      public void colorHSVA(float[] hsva)
      Sets the initial color of particles generated by this Emitter. emitter in HSVA space.
      Parameters:
      hsva - 4-element float array containing hue, saturation, color value, and alpha.
    • randomHSVA

      public void randomHSVA(float h, float s, float v, float a)
      Randomizes the initial color of particles generated by this Emitter. Each particle has its initial hue modified by a number in the range [-h/2, h/2]. The particle's other hsva channels are similarly randomized. Resulting hue values outside [0, 360) wrap around. Resulting saturation, value, and alpha values are clamped to [0, 1].
      Parameters:
      h - Hue randomization, in degrees. Hue is between 0 and 360.
      s - Saturation randomization. Saturation is between 0 and 1.
      v - Value randomization. Value is between 0 and 1.
      a - Alpha randomization. Alpha is between 0 and 1.
    • randomHSVA

      public void randomHSVA(float[] hsva)
      See Also:
    • colorShiftHSVA

      public void colorShiftHSVA(float h, float s, float v, float a)
      Adds color shift to particles, allowing individual particles to change color over time. If the resulting hue value falls outside [0, 360), it will wrap around. Resulting saturation, value, and alpha values are clamped to [0, 1].
      Parameters:
      h - Hue shift per second, in degrees
      s - Saturation shift per second
      v - Value shift per second
      a - Alpha shift per second
    • colorShiftHSVA

      public void colorShiftHSVA(float[] hsva)
      See Also:
    • colorShiftHSVA

      public void colorShiftHSVA(float minH, float maxH, float minS, float maxS, float minV, float maxV, float minA, float maxA)
      Adds color shift to particles, allowing individual particles to change color over time. Each particle is given a random hue velocity between minH and maxH, a random saturation velocity between minS and maxS, a random value velocity between minV and maxV, and a random alpha velocity between minA and maxA. If the resulting hue value falls outside [0, 360), it will wrap around. Resulting saturation, value, and alpha values are clamped to [0, 1].
      Parameters:
      minH - Minimum hue shift per second, in degrees
      maxH - Maximum hue shift per second, in degrees
      minS - Minimum saturation shift per second
      maxS - Maximum saturation shift per second
      minV - Minimum value shift per second
      maxV - Maximum value shift per second
      minA - Minimum alpha shift per second
      maxA - Maximum alpha shift per second
    • colorShiftHSVA

      public void colorShiftHSVA(float[] minHSVA, float[] maxHSVA)
      See Also:
    • hueShift

      public void hueShift(float minH, float maxH)
      See Also:
    • saturationShift

      public void saturationShift(float minS, float maxS)
      See Also:
    • colorValueShift

      public void colorValueShift(float minV, float maxV)
      See Also:
    • alphaShift

      public void alphaShift(float minA, float maxA)
      See Also:
    • radialVelocity

      public void radialVelocity(float minVelocity, float maxVelocity)
      Adds velocity in the direction from the emitter's location to each individual particle's randomized position. This effect causes particles to be pushed outwards from the emitter's location. No effect on emitters with no offset or positionSpread.
      Parameters:
      minVelocity - Minimum outward radial velocity, in world units / s.
      maxVelocity - Maximum outward radial velocity, in world units / s.
    • radialAcceleration

      public void radialAcceleration(float minAcceleration, float maxAcceleration)
      Adds acceleration in the direction from the emitter's location to each individual particle's randomized position.
      Parameters:
      minAcceleration - Minimum outward radial acceleration, in world units / s^2.
      maxAcceleration - Maximum outward radial acceleration, in world units / s^2.
      See Also:
    • revolutionRate

      public void revolutionRate(float minRate, float maxRate)
      Causes particles to revolve around the emitter's location at the time of generation. Note that updates to the emitter's location after a particle has already been generated are not received. This effect is applied after all other movement effects.
      Parameters:
      minRate - Minimum initial revolution velocity, in degrees / s.
      maxRate - Maximum initial revolution velocity, in degrees / s.
    • revolutionAcceleration

      public void revolutionAcceleration(float minAcceleration, float maxAcceleration)
      Parameters:
      minAcceleration - Minimum revolution acceleration, in degrees / s^2.
      maxAcceleration - Maximum revolution acceleration, in degrees / s^2.
      See Also:
    • sinusoidalMotionX

      public void sinusoidalMotionX(float minAmplitude, float maxAmplitude, float minFrequency, float maxFrequency, float minPhase, float maxPhase)
      Adds periodic motion along the emitter's x-axis. For each particle, if its phase is non-zero, will also translate that particle so that its initial position is unchanged at t = 0.
      Parameters:
      minAmplitude - Minimum amplitude of periodic motion along the emitter's x-axis, in world units.
      maxAmplitude - Maximum amplitude of periodic motion along the emitter's x-axis, in world units.
      minFrequency - Minimum number of complete cycles per second along the emitter's x-axis.
      maxFrequency - Maximum of complete cycles per second along the emitter's x-axis.
      minPhase - Minimum initial phase of periodic motion along the emitter's x-axis, in degrees.
      maxPhase - Maximum initial phase of periodic motion along the emitter's x-axis, in degrees.
    • sinusoidalMotionY

      public void sinusoidalMotionY(float minAmplitude, float maxAmplitude, float minFrequency, float maxFrequency, float minPhase, float maxPhase)
      Parameters:
      minAmplitude - Minimum amplitude of periodic motion along the emitter's y-axis, in world units.
      maxAmplitude - Maximum amplitude of periodic motion along the emitter's y-axis, in world units.
      minFrequency - Minimum number of complete cycles per second along the emitter's y-axis.
      maxFrequency - Maximum of complete cycles per second along the emitter's y-axis.
      minPhase - Minimum initial phase of periodic motion along the emitter's y-axis, in degrees.
      maxPhase - Maximum initial phase of periodic motion along the emitter's y-axis, in degrees.
      See Also:
    • getLocation

      public org.lwjgl.util.vector.Vector2f getLocation()
      Specified by:
      getLocation in class IEmitter
      Returns:
      Absolute location of this emitter, in world coordinates.
    • getSprite

      public com.fs.starfarer.api.graphics.SpriteAPI getSprite()
      Specified by:
      getSprite in class IEmitter
      Returns:
      Sprite that particles from this emitter will have. Can be null, in which a default particle will be used.
    • getXDir

      public float getXDir()
      Specified by:
      getXDir in class IEmitter
      Returns:
      Angle, in degrees, that this emitter's x-axis faces. If 0, then this emitter's axes coincides with global axes (x-axis facing to the right).
    • getBlendSourceFactor

      public int getBlendSourceFactor()
      Specified by:
      getBlendSourceFactor in class IEmitter
      Returns:
      Source blend factor, e.g. GL11.GL_SRC_ALPHA.
    • getBlendDestinationFactor

      public int getBlendDestinationFactor()
      Specified by:
      getBlendDestinationFactor in class IEmitter
      Returns:
      Destination blend factor, e.g. GL11.GL_ONE_MINUS_SRC_ALPHA.
    • getBlendFunc

      public int getBlendFunc()
      Specified by:
      getBlendFunc in class IEmitter
      Returns:
      Blending operation, e.g. GL14.GL_FUNC_ADD.
    • getLayer

      public com.fs.starfarer.api.combat.CombatEngineLayers getLayer()
      Specified by:
      getLayer in class IEmitter
      Returns:
      Combat layer particles should be rendered on.
    • getCampaignLayer

      public com.fs.starfarer.api.campaign.CampaignEngineLayers getCampaignLayer()
      Specified by:
      getCampaignLayer in class IEmitter
      Returns:
      Campaign layer particles should be rendered on.
    • isAlwaysRenderInCampaign

      public boolean isAlwaysRenderInCampaign()
      Specified by:
      isAlwaysRenderInCampaign in class IEmitter
      Returns:
      Whether the particles should persist through campaign location transitions. Note that particle and emitter positions are world-space-relative, not screen-space-relative, so dynamic anchoring and changing emitters' positions in a CurrentLocationChangedListener is required to fix particles' screen-space positions.
    • getRenderRadius

      public float getRenderRadius()
      Specified by:
      getRenderRadius in class IEmitter
      Returns:
      Distance from edge of screen beyond which particles are culled before generation. This applies to the emitter's location rather than individual particles' locations.
    • fromJSON

      public void fromJSON(org.json.JSONObject json) throws org.json.JSONException
      Loads properties from a JSON object.
      Parameters:
      json - JSON object to load from.
      Throws:
      org.json.JSONException - if the provided json is malformed.
    • writeJSON

      public void writeJSON(String name)
      Writes this emitter's properties to a file with the given name. The directory is specified in particleengine_settings.json.
      Parameters:
      name - File name to use